const baseUrl = window.REQUEST_URL;
import axios from "@/plugin/axios.js";
import $axios from "axios";
import qs from 'qs'
//获取角色权限列表
export function GetRolePermission(params) {
    return axios({
        url:baseUrl+"/role/GetRolePermission",
        method:"GET",
        params:params
    })
}
//保存数据
export function SaveOrUpdate(part, model) {
    return axios({
        url: baseUrl + "/" + part + "/SaveOrUpdate",
        method: "post",
        data: model
    })
}
//删除流程
export function DeleteHandleprocess(params) {
    return axios({
        url:baseUrl+"/handleprocess/DeleteHandleprocess",
        method:"post",
        data:params
    })
}
//根据id删除
export function DeleteById(part, model) {
    return axios({
        url: baseUrl + "/" + part + "/DeleteById",
        method: "post",
        data: qs.stringify(model)
    })
}
//获取记录列表
export function GetHandlerecordList(params) {
    return axios({
        url:baseUrl+"/handlerecord/GetHandlerecordList",
        method:"GET",
        params:params
    })
}
//模糊查询组织机构信息
export function GetOrganizationList(model) {
    return axios({
        url:baseUrl+"/organization/GetOrganizationList",
        method:"GET",
        params:model
    })
}
// 获取用户信息
export function QueryUserInfo(model) {
    return axios({
        url: baseUrl + "/person/GetPersonList",
        method: "get",
        params: model
    });
}
//获取流程
export function GetHandleProcessList(params) {
    return axios({
        url:baseUrl+"/handleprocess/GetHandleprocessList",
        method:"GET",
        params:params
    })
}
export function GetById(part, id) {
    return axios({
        url: baseUrl + "/" + part + "/GetById",
        method: "get",
        params: {
            id: id
        }
    })
}
// 删除用户{ item }
export function RemoveUserInfo(item) {
    return axios({
        url: baseUrl + "/person/DeletePerson",
        method: "post",
        data: item
    });
}
//更改人员角色关系
export function SaveOrUpdatePersonRole(params) {
    return axios({
        url:baseUrl+"/personrole/SaveOrUpdatePersonRole",
        method:"post",
        data:qs.stringify(params)
    })
}
export function GetList(part, model) {
    return axios({
        url: baseUrl + "/" + part + "/GetList",
        method: "get",
        params: model
    })
}
//获取记录列表
export function getInfoByRecordid(params) {
    return axios({
        url:baseUrl+"/handlerecord/getInfoByRecordid",
        method:"GET",
        params:params
    })
}
/**
 * 审批
 * @param {*} recordid  记录id
 * @param {*} nodeid 节点id
 * @param {*} disposerid 处理人id
 * @param {*} disposername 处理人
 * @param {*} handletime 处置时间
 * @param {*} result 处置结果1通过 0不通过
 * @param {*} suggestion 处置建议
 * @returns 
 */
export function approval(model) {
    return axios({
        url: baseUrl + "/handlerecorddetail/SaveOrUpdateDetail",
        method: "post",
        data: model
    })
}
export function DeleteHandlerecord(model) {
    return axios({
        url: baseUrl + "/handlerecord/DeleteHandlerecord",
        method: "post",
        data: qs.stringify(model)
    })
}
export function startProcess(model) {
    return axios({
        url: baseUrl + "/handlerecord/startProcess",
        method: "post",
        data: model
    })
}